<div id="content">
                    	<h3>Danh sách đơn hàng</h3>
                        
                        <div id="contentFunc">
                            <div class="search">
                            	<label class="" >Tình trạng: </label>
								<?php 
                                    $attributes = array('id'=>'frmDDH','name'=>'frmDDH','method'=>'get');
                                    echo form_open_multipart('Quanlydonhang/index',$attributes);	         
							  
											$options = array(
												'0'=>'Tất cả',
												'1'=>'Chưa giao',
												'2'=>'Đã giao'
											);
										 if(isset($tt))
											{
												echo form_dropdown('tt', $options, $tt); 
											}
										 else
											{
												echo form_dropdown('tt', $options,null);
											}			
										 
								?>
                                <input type="submit" id="btnSearch" value="Tìm"/>
                                </form>
                            </div>
                             <div class="pageList">
                             	<?php 
									if(isset($pages))
									{
										for ( $p = 1; $p <=$pages+1; $p ++ )
										{
											if(!empty($tt))	
											{
											echo "<a href='".base_url()."index.php/Quanlydonhang/index?tt={$tt}&page={$p}'>{$p}</a>";
											}
											else
											echo "<a href='".base_url()."index.php/Quanlydonhang/index?tt=0&page={$p}'>{$p}</a>";
										}
									}
								?>
                             </div>
                            <div class="dataSP">
                                <table class="tableSanPham">
                                    <tr class="colName">
                                        <th class="colValue">STT</th>
                                        <th class="colValue">Người nhận</th>
                                        <th class="colValue">Địa chỉ</th>
                                        <th class="colValue">Số điện thoại</th>
                                        <th class="colValue">Trị giá</th>
                                        <th class="colValue">Ngày đặt hàng</th>
                                        <th class="colValue">Thanh toán</th>
                                        <th class="colValue">Tình trạng</th>
                                        <th class="colValue">Xem</th>
                                        <th class="colValue">Xóa</th>
                                    </tr>
                                  
                                    <?php 
								
										if(!empty($dondathangs))
										{
											
											for($stt=0 ;$stt<count($dondathangs);$stt++)
											{	
												
												$ddh=$dondathangs[$stt];
												echo "<tr class='rowValue'>";
												
												echo "<td class='rowId'>".(($page-1) * $pagesize + $stt+1)."</td>";
												echo "<td>{$ddh['nguoinhan']}</td>";
												echo "<td>{$ddh['diachi']}</td>";
												echo "<td>{$ddh['sodienthoai']}</td>";
												echo "<td class='rowId'>{$ddh['trigia']}</td>";
												echo "<td>{$ddh['ngaydathang']}</td>";
												if($ddh['thanhtoan']==1)
												{
													echo "<td>Đã thanh toán</td>";
												}else
												{
													echo "<td>Chưa thanh toán</td>";
												}
											if($ddh['tinhtrang']==1)
											{
												echo "	<td>";
												if(!empty($tt))	
												{
                                                echo "	<a href='".base_url()."index.php/Quanlydonhang/giao/{$ddh['maddh']}?tt={$tt}&page={$page}'>Giao</a>";
												}
                                              	else
											   echo "	<a href='".base_url()."index.php/Quanlydonhang/giao/{$ddh['maddh']}?tt=0&page={$page}'>Giao</a>";
											    echo "	</td>";
											}
											else if($ddh['tinhtrang']==2)
											echo "<td>Đã giao</td>";	
											
												echo "<td>";
												echo "<a href='". base_url()."index.php/Quanlydonhang/chitiet/{$ddh['maddh']}'>";
												echo "<img src='".base_url()."images/sdetail.png' alt='Xem'/>";
												echo "	</a>";
                                                echo "	</td>";
                                                
                                                echo "	<td>";
												
												if(!empty($tt))	
												{
													  echo "	<a href='".base_url()."index.php/Quanlydonhang/xoa/{$ddh['maddh']}?tt={$tt}&page={$page}'>";
												}
												else
													  echo "	<a href='".base_url()."index.php/Quanlydonhang/xoa/{$ddh['maddh']}?tt=0&page={$page}'>";
													
											    echo "			<img src='".base_url()."images/sdelete.png' alt='Xóa'/>";
                                                echo "		</a>";
                                                echo "	</td>";
                                                echo "</tr>";
													}	
												}
									?>
                                </table>
                            </div>
                        </div>
                    </div>
            </div>
            
            
            
            
            
            
            
            
            
            
            
            
            
            
            